package com.chinawayltd.ews.sample.job;

import org.quartz.JobExecutionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.chinawayltd.ews.sample.service.SynchroMainDataService;
import com.chinawayltd.ews.sample.taskCenter.TaskJob;

/**
 * @program: greeProject-timingTaskCenter
 * @description 首页数据同步任务
 * @author: chenxin
 * @create: 2018年5月22日 上午12:33:11
 */
@Component
public class SynchroMainDataJob implements TaskJob {

    private static Logger logger = LoggerFactory.getLogger(SynchroMainDataJob.class);

    @Autowired
    private SynchroMainDataService synchroMainDataService;
    @Override
    @Transactional
    public void doJob(JobExecutionContext context) {
        try {
        	synchroMainDataService.synchroMainData();
        } catch (Exception e) {
            logger.error("首页数据同步任务发生错误！", e);
        }
    }

}
